﻿using System;
using System.Collections;
using System.Collections.Generic;
namespace WPFExcelReport
{
    public class GB02Report : BaseReport
    {
        string strCompany = "HLT";
        string strExcelFile = "";
        public GB02Report()
            : base()
        {
            AssignColumns();
        }
        public GB02Report(Dictionary<string, object> dicParamater)
            : base(dicParamater)
        { 
            strCompany = dicParamater["Company"].ToString().Trim();
            strExcelFile = dicParamater["ExcelFile"].ToString().Trim();
            AssignColumns();
           
        }
        private void AssignColumns()
        {
            columns.Add("CODE"); columns.Add("GLLB");
            columns.Add("ART"); columns.Add("VAR"); columns.Add("SUPPLIER");
            columns.Add("BATCH"); columns.Add("SUPPLIERBATCH"); columns.Add("INCOMEDATE"); columns.Add("WEI");
            
        }
        public void REPORT2EXCEL(string fileType)
        {  
            Queue CellQueue = new Queue(); 
            string filename = "";
            string sheetName = "";
            string Standard = "Technical_Yarn_Stock";
            strExcelFile = @"HLT\HLTSummaryReport.xls";
            string filePath = @"C:\intex.w\Report\" + strExcelFile;
            exAgent.Open(filePath);
            exAgent.Company = "";
            exAgent.strExcelFile = strExcelFile;
            string filedate = DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Day.ToString();
            filename = @"Development\纱线库存表" + filedate + ".xls";
            sheetName = DateTime.Now.ToShortTimeString().Replace(@":","");
            exAgent.CreateNewSheet(filename, Standard, sheetName);
            FillInData(columns, dsSource.Tables["YARN_INVENTORY"]); 
            if (exAgent != null)
            {
                exAgent.Save();
                exAgent.Close();
            }
        } 
    }
    }


